var section = 0;

function changeSection(sectionNumber)
{
	if(section>0)
	{
		switch(section)
		{
			case 1:
				$("menu_item_empire").removeClassName("selected_menu");
				$("empire").removeClassName("selected_section");
				break;
						
			case 2:
				$("menu_item_universe").removeClassName("selected_menu");
				$("universe").removeClassName("selected_section");
				break;
							
			case 3:
				$("menu_item_messages").removeClassName("selected_menu");
				$("messages").removeClassName("selected_section");
				break;
						
			case 4:
				$("menu_item_planet").removeClassName("selected_menu");
				$("planet").removeClassName("selected_section");
				break;
				
			case 5:
				$("menu_item_open").removeClassName("selected_menu");
				$("open").removeClassName("selected_section");
				break;
		}
	}

	switch(sectionNumber)
	{
		case 1:		//empire
			$("menu_item_empire").addClassName("selected_menu");
			$("empire").addClassName("selected_section");
			section=1;
			break;
						
		case 2:		//universe
			$("menu_item_universe").addClassName("selected_menu");
			$("universe").addClassName("selected_section");
			section=2;
			break;
						
		case 3:		//messages
			$("menu_item_messages").addClassName("selected_menu");
			$("messages").addClassName("selected_section");
			ajaxUpdater("messages",mainMessages);
			section=3;
			break;
				
		case 4:		//planet
			$("menu_item_planet").addClassName("selected_menu");
			$("planet").addClassName("selected_section");
			section=4;
			break;
				
		case 5:		//open
			$("menu_item_open").addClassName("selected_menu");
			$("open").addClassName("selected_section");
			section=5;
			break;
	}
}

function showMenu(menu)
{
    Effect.SlideDown(menu, { duration: 0.3 });
}

function hideMenu(menu) 
{
    Effect.SlideUp(menu, { duration: 0.3 });
}

